//
//  HomeCell.m
//  项目1 CLCMovie
//
//  Created by huiwenjiaoyu on 15/7/20.
//  Copyright (c) 2015年 CLC. All rights reserved.
//

#import "HomeCell.h"
#import "UIImageView+WebCache.h"

@implementation HomeCell

- (void)awakeFromNib {

    self.selectionStyle  = UITableViewCellSelectionStyleNone;
    // Initialization code
}

- (void)setModal:(HomeModal*)modal
{
    self.homeModal = modal;
    
    
}

- (void)layoutSubviews
{
    UIImageView* imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab_bg_all"]];
    imgView.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
    [self setBackgroundView:imgView];
    
    
    _titleLabel.text = _homeModal.title;
    _titleLabel.textColor = [UIColor whiteColor];
    
    _yearLabel.text = _homeModal.year;
    _yearLabel.textColor = [UIColor whiteColor];

    
    _mark.text = [NSString stringWithFormat:@"评分:%.1f",_homeModal.mark];
    _mark.textColor = [UIColor whiteColor];
    _starView.mark = _homeModal.mark;
    
    
    NSString* imgUrl = [NSString stringWithFormat:@"%@",[_homeModal.images valueForKey:@"small"]];
    NSURL* url = [NSURL URLWithString:imgUrl];
    [self.iconImageView sd_setImageWithURL:url];
    

    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
